﻿




using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Hotpot.Extensions;
using Hotpot.Models;
using Hotpot.Services;
using Hotpot.ViewModels;

namespace Hotpot.Modules.Core.Controllers
{
    public class UtilityController : Controller
    {
        public ViewResult OpenSearch()
        {
            return View(new HotpotViewModel());
        }

        public ViewResult OpenSearchOSDX()
        {
            return View(new HotpotViewModel());
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ContentResult ComputeHash(string value)
        {
            return Content(value.ComputeHash(), "text/plain");
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ContentResult GetDateTime(string dateTimeString)
        {
            DateTime dateTime = default(DateTime);

            if (DateTime.TryParse(dateTimeString, out dateTime))
                return Content(dateTime.ToStringForEdit(), "text/plain");

            return Content(DateTime.Now.ToStringForEdit(), "text/plain");
        }

        public HotpotViewModel RobotsTxt()
        {
            return new HotpotViewModel();
        }
    }
}
